﻿package mortal.game.view.copy.ChallengeCopy.view
{
    import __AS3__.vec.*;
    import com.mui.controls.*;
    import com.mui.core.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class StarPointPanel extends GSprite
    {
        private var _starAmount:int;
        private var _value:int;
        private var _starList:Vector.<GBitmap>;
        private var _brightUrl:String = "PointStar";
        private var _darkUrl:String = "PointStarNone";
        private var _gat:int = 22;
        private var _starY:Array;

        public function StarPointPanel()
        {
            this._starList = new Vector.<GBitmap>;
            this._starY = [];
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._starY.splice(0);
            this._starList.length = 0;
            this._brightUrl = ImagesConst.PointStar;
            this._darkUrl = ImagesConst.PointStarNone;
            this._gat = 22;
            return;
        }// end function

        public function setStarStyle(param1:String, param2:String, param3:int) : void
        {
            this._brightUrl = param1;
            this._darkUrl = param2;
            this._gat = param3;
            return;
        }// end function

        public function set totalStar(param1:int) : void
        {
            var _loc_2:GBitmap = null;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            this._starAmount = param1;
            while (_loc_4 < this._starAmount)
            {
                
                _loc_3 = this._starY.length > 0 ? (this._starY[_loc_4]) : (0);
                _loc_2 = UIFactory.gBitmap("", _loc_4 * this._gat, _loc_3, this);
                this.pushUIToDisposeVec(_loc_2);
                this._starList.push(_loc_2);
                _loc_4++;
            }
            return;
        }// end function

        public function set starY(param1:Array) : void
        {
            this._starY = param1;
            return;
        }// end function

        public function get totalStar() : int
        {
            return this._starAmount;
        }// end function

        public function set value(param1:int) : void
        {
            this._value = param1;
            var _loc_2:int = 1;
            while (_loc_2 <= this._starAmount)
            {
                
                if (_loc_2 <= param1)
                {
                    this._starList[(_loc_2 - 1)].bitmapData = GlobalClass.getBitmapData(this._brightUrl);
                }
                else
                {
                    this._starList[(_loc_2 - 1)].bitmapData = GlobalClass.getBitmapData(this._darkUrl);
                }
                _loc_2++;
            }
            return;
        }// end function

        public function get value() : int
        {
            return this._value;
        }// end function

    }
}
